<?php
$query_string = $_SERVER["QUERY_STRING"];
$query_string = preg_replace("/[&]?lang=" . @$_GET["lang"] ."/", "", $query_string);
$query_string = (!empty($query_string) && strpos($query_string, "&") !== 0) ? "&" . $query_string : $query_string;

$linkEn = $_SERVER["PHP_SELF"]."?lang=en";
$linkVn = $_SERVER["PHP_SELF"]."?lang=vi";
if(!empty($query_string)){
	$linkEn = $_SERVER["PHP_SELF"]."?lang=en{$query_string}";
	$linkVn = $_SERVER["PHP_SELF"]."?lang=vi{$query_string}";
}

$sessionID = $_SESSION['my_admin_id'];
$sessionName = single_select("admin_user", "userName", "`userID` = '$sessionID'");

?>
<div id="header" class="clearfix">
	<ul id="hNavi2" class="clearfix">
		<li><a href="<?php echo $linkVn; ?>"><img src="<?php echo base_common_admin; ?>images/flg_vi.png" alt="Tiếng Việt" /></a></li>
		<li><a href="<?php echo $linkEn; ?>"><img src="<?php echo base_common_admin; ?>images/flg_en.png" alt="English" /></a></li>
	</ul>
	<p id="logo"><img src="<?php echo base_common_admin; ?>images/logo.png" alt="<?php echo $lang["header"]["logo"]; ?>" /></p>
	<div class="hBlock clearfix">
		<p class="textBlock"><?php echo $lang["header"]["textBlock1"]; ?>　<strong><?php echo $sessionName; ?></strong>　<?php echo $lang["header"]["textBlock2"]; ?></p>
		<p class="logout"><a href="<?php echo base_index_admin; ?>logout"><?php echo $lang["header"]["logout"]; ?></a></p>
	<!-- / class hBlock --></div>
<!-- / id header --></div>